<!--/**
* Author: ganqz
* Date: 2022-07-28 20:14
* Desc: SharePopup
*/
-->
<template>
  <zm-popup v-model="show" @close="close" closeable :round="20">
    <view class="share-pop__content">
      <view class="fs28 b tl mb60">自购省钱，分享赚钱</view>
      <view class="content flex flex-space-between tip-list">
        <!-- <image :src="shareImage" width="100%" height="193rpx"></image> -->
        <img :src="shareImage" class="share-list-img" />
      </view>
      <view class="desc tc mb30">邀请{{ info.maxman }}个用户注册,{{ info.maxorder }}个用户购买后,即可开始赚佣金！</view>
      <yy-button size="large" color="#fff" plain @click="onShare">立即分享</yy-button>
    </view>
  </zm-popup>
</template>
<script>
  import ZmPopup from '@/commons/ZmPopup/index.vue'
  // import ZmImage from '@/commons/ZmImage/index.vue'
  import { SHARE_POP_IMG } from '@/model/imgConst'
  export default {
    name: 'share-popup',
    components: { ZmPopup },
    props: {
      value: {
        type: Boolean,
        default: false
      },
      obj: {
        type: Object,
        default: () => {
          return {
            type: 'coupon|normal', //coupon 电影券,product商品
            id: ''
          }
        }
      }
    },
    data() {
      return {
        shareImage: SHARE_POP_IMG,
        info: {}
      }
    },
    mounted() {
      this.init()
    },
    computed: {
      show: {
        set(v) {
          // #ifdef H5
          if (v) {
            uni.hideTabBar()
          } else {
            uni.showTabBar()
          }
          // #endif
          this.$emit('input', v)
        },
        get() {
          // #ifdef H5
          if (this.value) {
            uni.hideTabBar()
          } else {
            uni.showTabBar()
          }
          // #endif
          return this.value
        }
      }
    },
    methods: {
      init() {
        console.log('getMemberMission')
        uni.$api.user.getMemberMission().then((res) => {
          this.info = res
        })
      },
      onShare() {
        this.$emit('click')
        this.close()
      },
      close() {
        this.$emit('input', false)
      }
    }
  }
</script>
<style lang="scss" scoped>
  .share-pop {
    &__content {
      .share-list-img {
        height: 193rpx;
        width: 100%;
      }
      padding: 40rpx 30rpx 37rpx;
      .tip-list {
        margin: 35rpx 0 30rpx;
      }
      .desc {
        font-size: 28rpx;
        color: #fa5a0b;
        line-height: 21rpx;
      }
    }
  }
</style>
